package cn.ycc1.boot3kafka.entity;

import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author ycc
 * @date 2025/11/16
 */
@Data
public class UserMessage implements Serializable {
    private static final long serialVersionUID = 1L;

    private Long id;
    private String name;
    private String email;
    private LocalDateTime timestamp;

    // 构造方法
    public UserMessage() {}

    public UserMessage(Long id, String name, String email) {
        this.id = id;
        this.name = name;
        this.email = email;
        this.timestamp = LocalDateTime.now();
    }

    @Override
    public String toString() {
        return "UserMessage{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", email='" + email + '\'' +
                ", timestamp=" + timestamp +
                '}';
    }
}
